package com.zryc.shop.ums.mapper;

import com.zryc.shop.ums.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 后台菜单表 Mapper 接口
 * </p>
 *
 * @author zhaozhao
 * @since 2024-01-16
 */
public interface MenuMapper extends BaseMapper<Menu> {

    /**
     * 根据角色id 查询菜单列表
     *
     * @param roleId
     * @return
     */
    List<Menu> getMenuByRoleId(Long roleId);

    /**
     * 删除中间表该菜单和子菜单记录
     *
     * @param id
     */
    int deleteFromMiddle(@Param("id") Long id);

}
